package com.itlong.cloud.operate.resource;

import com.itlong.cloud.POJO.DTO.operate.OperateModuleGetPageDTO;
import com.itlong.cloud.POJO.DTO.operate.OperatePropertyValueSaveDTO;
import com.itlong.cloud.POJO.VO.operate.*;
import com.itlong.cloud.operate.service.IOperatePropertyValueService;
import com.itlong.cloud.project.operate.IOperatePropertyValueServiceClient;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <desc>
 *      运营物业增值模块暴露接口实现类
 * <desc/>
 *
 * @createDate 2017/10/23.
 */
@RestController
public class OperatePropertyValueServiceResource implements IOperatePropertyValueServiceClient {

    @Autowired
    IOperatePropertyValueService iOperatePropertyValueService;
    /**
     * <desc>
     *      获取分页列表
     * </desc>
     *
     * @param dto
     * @return
     * @author Jiaqi.X
     * @createDate 2019/05/29
     */
    @PostMapping("/operate/propertyValue/module/list")
    @Override
    public Page<OperateModuleGetPageVO> getPage(@RequestBody OperateModuleGetPageDTO dto) throws Exception {
        return iOperatePropertyValueService.getPage(dto);
    }

    /**
     * <desc>
     *      获取单个对象
     * </desc>
     *
     * @param moduleId
     * @return
     * @author Jiaqi.X
     * @createDate 2019/05/29
     */
    @Override
    @PostMapping("/operate/propertyValue/module/getOne")
    public OperatePropertyValueGetOneVO getOne(@RequestParam("moduleId") String moduleId,@RequestParam("projectId") String projectId) {
        return iOperatePropertyValueService.getOne(moduleId,projectId);
    }

    /**
     * <desc>
     *      保存物业增值配置
     * </desc>
     *
     * @param dto
     * @return
     * @author Jiaqi.X
     * @createDate 2019/05/29
     */
    @Override
    @PostMapping("/operate/propertyValue/module/save")
    public String save(@RequestBody OperatePropertyValueSaveDTO dto) throws Exception{
        return iOperatePropertyValueService.save(dto);
    }
}
